package com.hundsun.documentripper.error;

import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

/**
 * Note：
 *
 * @author ：mengjw
 * @description：错误信息
 * @date ：Created in 2021/1/26
 */
public class ErrorMessage {

    private static Map<String, String> errorMessages = new HashMap<String, String>();

    public static String getMessage(String code) {
        return errorMessages.get(code);
    }

    static {
        try {
            Properties properties = new Properties();
            properties.load(new InputStreamReader(
                    ErrorMessage.class.getClassLoader().getResourceAsStream("error.properties"), "UTF-8"));
            errorMessages = new HashMap<String, String>((Map) properties);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}